package com.ycp.erp.bill.ui.fragment;

import android.os.Bundle;

import com.one.common.view.base.IListView;
import com.one.common.view.pagestate.listpage.BaseListFragment;
import com.ycp.erp.bill.model.bean.Bill;
import com.ycp.erp.bill.presenter.BillPersenter;
import com.ycp.erp.bill.ui.binder.BillManagerBinder;

/**
 * Class Des:
 * Created by bjh on 2021/9/7.
 */
public class BillFragment extends BaseListFragment<BillPersenter> implements IListView {
    private int billState;

    @Override
    protected void initPresenter() {
        mPresenter=new BillPersenter(this,getContext());
    }

    @Override
    public void registerDate() {
        BillManagerBinder binder =new BillManagerBinder();
        register(Bill.class,binder);
    }

    @Override
    public void loadData() {
        mPresenter.getBills(billState);
    }

    @Override
    public void initData() {
        super.initData();
        Bundle bundle = getArguments();
        billState = bundle.getInt("billState");
        loadData();
    }
    /**
     * 获取一个任务列表的实例
     */
    public static BillFragment getInstance(int billState) {
        BillFragment fragment = new BillFragment();
        Bundle bundle = new Bundle();
        bundle.putInt("billState", billState);
        fragment.setArguments(bundle);
        return fragment;
    }
}
